<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:c="http://java.sun.com/jsp/jstl/core"
	  			xmlns:p="http://primefaces.prime.com.tr/ui"
				template="/WEB-INF/layouts/standard.xhtml">

<ui:define name="title">Login</ui:define>

<ui:define name="notes">
	<h5>Configuration to review:</h5>
	<ul>
		<li>Spring Security filter and taglib declarations: src/main/webapp/WEB-INF/web.xml</li>
  		<li>Spring Security configuration: src/main/webapp/WEB-INF/spring/security-config.xml</li>
  		<li>Taglib file: src/main/webapp/WEB-INF/springsecurity.taglib.xml</li>
	</ul>
	<hr/>
</ui:define>

<ui:define name="content">
<div class="span-10">
	<c:if test="${not empty param.login_error}">
		<div class="error">
			Your login attempt was not successful, try again.<br />
			Reason: #{sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}
		</div>
	</c:if>
	<p:panel header="Login Information">
		<form name="f" action="${request.contextPath}/app/j_spring_security_check" method="post">
			<p>
				User:
				<br />
				<c:if test="${not empty param.login_error}">
					<c:set var="username" value="${sessionScope.SPRING_SECURITY_LAST_USERNAME}"/>
				</c:if>
				<input type="text" name="j_username" value="#{username}"/>
			</p>
			<p>
				Password:
				<br />
				<input type="password" name="j_password" />				
			</p>
			<p>
				<input type="checkbox" name="_spring_security_remember_me"/> 
				Don't ask for my password for two weeks
			</p>
			<p>
				<input name="submit" type="submit" value="Login" />
			</p>
		</form>
	</p:panel>
</div>
<div class="prepend-1 span-12 last">
	<h5>Username/password pairs:</h5>
	<ul>
		<li>keith/melbourne</li>
	    <li>rossen/london</li>
	</ul>
	<h5>Roles assigned:</h5>
	<ul>
		<li>keith has ROLE_USER and ROLE_APPLE_USER</li>
	    <li>rossen has ROLE_USER and ROLE_ANDROID_USER</li>
	</ul>
</div>
</ui:define>
</ui:composition>